package org.desktop.web.shared.domain.entities;

import java.io.Serializable;

import javax.persistence.*;

import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;


/**
 * The persistent class for the USERS_PROJECT database table.
 * 
 */
@Entity
@Table(name="USERS_PROJECT")
@NamedQuery(name="UsersProject.findAll", query="SELECT u FROM UsersProject u")
@JsonAutoDetect(fieldVisibility=Visibility.ANY)
@JsonInclude(Include.NON_NULL)
public class UsersProject implements Serializable, com.google.gwt.user.client.rpc.IsSerializable {
	private static final long serialVersionUID = 1L;
	private String id;
	@JsonProperty("idSubProject")
	private SubProject subProject;
	
	@JsonProperty("idUser")
	private User user;

	public UsersProject() {
	}


	@Id
	@Column(unique=true, nullable=false, length=100)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}


	//bi-directional many-to-one association to SubProject
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="ID_SUB_PROJECT", nullable=false)
	public SubProject getSubProject() {
		return this.subProject;
	}

	public void setSubProject(SubProject subProject) {
		this.subProject = subProject;
	}


	//bi-directional many-to-one association to User
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="ID_USER", nullable=false)
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

}